const http=require('http');
http.createServer(function(req,res){
    if(req.url.indexOf('?')!=-1){
        const arr=req.url.split('?')[1];//arr[0]=>'/aa'  arr[1]=>'user=1&pass=1'
        const arr1=arr.split('&'); //['user=1','pass=1']
        let getData={}
        arr1.map((item,index)=>{
            const data=item.split('=');
            getData[data[0]]=data[1]
        })
        console.log(getData); //{ user: '1', pass: '1' }
    }
    res.write('aa');
    res.end();
}).listen(8080)